let mysql = require("mysql");



function sql(sql,arr=[], cellback) {
    // 创建数据库链接
    let connection = mysql.createConnection({
        //主机名
        host: "43.136.72.69",
        user: "facial",
        password: "123456",
        database: "facial"

    })
    //连接数据库

    connection.connect();

    // 指令控制
    connection.query(sql,arr, function (err, res, fie) {
        if (err) throw err;
        console.log("====数据库链接成功！====")
        cellback(res);
    })

    // 断开数据库连接
    connection.end();
}

//暴露模块
module.exports = sql;